#include "signaltransfer.h"

SignalTransfer* SignalTransfer::m_pInstance = nullptr;

SignalTransfer *SignalTransfer::instance()
{
    if(!m_pInstance)
        m_pInstance = new SignalTransfer;

    return m_pInstance;
}

void SignalTransfer::closeInstance()
{
    if(m_pInstance)
        delete m_pInstance;
    m_pInstance = nullptr;
}

SignalTransfer::SignalTransfer(QObject *parent)
    : QObject{parent}
{
    m_settings = new QSettings("ZDIT", "TETRIS", this);

    m_blockSideLength = 40;
}

int SignalTransfer::blockSideLength() const
{
    return m_blockSideLength;
}

void SignalTransfer::setBlockSideLength(int newBlockSideLength)
{
    m_blockSideLength = newBlockSideLength;
//    m_settings->setValue("BlockSideLength", m_blockSideLength);
}

QSettings *SignalTransfer::settings() const
{
    return m_settings;
}
